package com.lyy.processor;

import lombok.SneakyThrows;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @author Liangyaoyun
 */
public class MyBeanPostProcessor implements BeanPostProcessor {
    @SneakyThrows
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) {
        System.out.println("后置处理器: 在初始化方法之前执行");
        return bean;
    }

    @SneakyThrows
    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) {
        System.out.println("后置处理器: 在初始化方法之后执行");
        return bean;
    }
}
